﻿// ***
// *** Copyright (C) 2013, Daniel M. Porrey.  All rights reserved.
// *** Written By Daniel M. Porrey
// ***
// *** This software is provided "AS IS," without a warranty of any kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, 
// *** INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. DANIEL M PORREY 
// *** AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE 
// *** OR ITS DERIVATIVES. IN NO EVENT WILL DANIEL M PORREY OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, 
// *** SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF 
// *** OR INABILITY TO USE THIS SOFTWARE, EVEN IF DANIEL M PORREY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 
// ***
// *** Licensed under Microsoft Public License (Ms-PL)
// *** This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, 
// *** do not use the software. Full license details can be found at https://angle.codeplex.com/license.
// ***
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Innovative.Geometry;

namespace Innovative.Geometry.Demo
{
	class Program
	{
		static void Main(string[] args)
		{
			// ***
			// *** Reverse the direction of an Angle
			// ***
			Angle a1 = new Angle(90);
			Angle a2 = !a1;

			// ***
			// *** Initialize an Angle using a value in degrees:
			// ***
			{
				Angle latitude = new Angle(41.6);
				Angle longitude = -88.0;
				Console.WriteLine("{0}, {1}", latitude.ToShortFormat(), longitude.ToShortFormat());
			}

			// ***
			// *** Initialize an Angle using degrees, arc minutes and arc seconds:
			// ***
			{
				Angle latitude = new Angle(41, 20, 5.1);
				Console.WriteLine(latitude.ToLongFormat());
			}

			// ***
			// *** Convert an Angle to a decimal:
			// ***
			{
				Angle latitude = new Angle(41.6);
				decimal value = latitude;
				decimal decimalValue = latitude * 2m;
				Console.WriteLine(((Angle)decimalValue).ToLongFormat());
			}
		}
	}
}
